/*
 * HexTDTower.java
 *
 * Created on November 24, 2007, 3:30 PM
 *
 * Copyright (C) 2007-2008  Hylke van der Schaaf
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, in version 3 of the License.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
package hextd.tower;

import hextd.map.JsonTower;
import hextd.hex.HexTile;
import hextd.util.TowerChangeListener;
import com.usoog.tdcore.exception.TileAlreadyHasTowerException;
import com.usoog.tdcore.exception.TileNotBuildableException;
import com.usoog.tdcore.player.Player;
import com.usoog.tdcore.tower.Tower;
import hextd.core.GameStateImplementation;

/**
 *
 * @author hylke
 */
public interface HexTDTower extends Tower {

	public FactoryTower.type getType();

	public void init(
			GameStateImplementation gs,
			HexTile hex,
			Player owner,
			int activateTick)
			throws TileAlreadyHasTowerException, TileNotBuildableException;

	public void setSelected(boolean selected);

	public String getStatusString();

	public PanelTowerSettings getButtons();

	public double getRangeBase();

	public double getRangeCurrent();

	/**
	 * Change per-map settings of a tower. Used when instantiating towers
	 * that are defined in a map. Should not be used during game as changes
	 * are not recorded.
	 * @param key the name of the setting to change
	 * @param value the value to change the setting to.
	 */
	public void setSetting(JsonTower.optionKey key, String value);

	public void registerTower(HexTDTower t);

	public void unregisterTower(HexTDTower t);

	public void addTowerChangeListener(TowerChangeListener l);

	public void removeTowerChangeListener(TowerChangeListener l);
}
